function ajaxhla2002a_valAllele(objForm)
{
	var iBand=0;
	var sAllele="";
	var sPop="";
	var sLine="";	
	var sResponse="";
	var sURL = "ajaxhla2002a_val1.asp";	
	
	//... Validate allele value ...//
	sAllele = document.getElementById("hapd_allele").value;
	sPop = document.getElementById("hapd_popid").value;	
	sLine = document.getElementById("hapd_line").value;	
	
	if(sAllele!="")
	{
		//... Verify if the allele has been submitted or if is a right allele ...//
		try
		{  
			 // Firefox, Opera 8.0+, Safari  
			 xmlHttp=new XMLHttpRequest();  
		 }
		 catch (e)
		 { 
			 // Internet Explorer  
			 try
			 {    
				   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
			 }
			 catch (e)
			 {    
				   try
				   {      
						 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");     
				   }
				   catch (e)
				   {      
						 //alert("Your browser does not support AJAX!");      
						 return false;      
				   }    
			 }  
		 }	   
		 xmlHttp.onreadystatechange=function()
		 {
			 if(xmlHttp.readyState==4)
			 {
				   sResponse = xmlHttp.responseText;
				   if(sResponse != "OK")
				   {
						alert(sResponse);
						document.getElementById("hapd_allele").focus();
						return false;
				   }
				   else
				   {
						objForm.submit();
						return true;					   					   
				   }
			 }
		 }
		 sURL = sURL + "?" + "hapd_popid=" + sPop + "&hapd_allele=" + sAllele + "&hapd_line=" + sLine;
		 xmlHttp.open("GET", sURL, true);
		 xmlHttp.send(null);
	}
	else
	{
		alert("Please type a value for the allele.");
		document.getElementById("hapd_allele").focus();		
	  	return false;
	}
}
function ajaxhla2002a_valHaplo(objForm)
{
	var sURL = "ajaxhla2002a_val2.asp";	
	var sHaplotype="";
	var sFreq="";
	var sPop="";
	
	//... Validate haplotype value ...//
	sHaplotype = document.getElementById("hapf_haplotype").value;
	sFreq = document.getElementById("hapf_freq").value;	
	sPop = document.getElementById("hapf_popid").value;		
	if(sFreq!="")
	{
		if(sHaplotype!="")
		{
			//... Verify if the allele has been submitted or if is a right allele ...//
			try
			{  
				 // Firefox, Opera 8.0+, Safari  
				 xmlHttp=new XMLHttpRequest();  
			 }
			 catch (e)
			 { 
				 // Internet Explorer  
				 try
				 {    
					   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
				 }
				 catch (e)
				 {    
					   try
					   {      
							 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");     
					   }
					   catch (e)
					   {      
							 //alert("Your browser does not support AJAX!");      
							 return false;      
					   }    
				 }  
			 }	   
			 xmlHttp.onreadystatechange=function()
			 {
				 if(xmlHttp.readyState==4)
				 {
					   sResponse = xmlHttp.responseText;
					   if(sResponse != "OK")
					   {
							alert(sResponse);
							document.getElementById("hapd_allele").focus();
							return false;
					   }
					   else
					   {
							objForm.submit();
							return true;
					   }
				 }
			 }
			 sURL = sURL + "?" + "hapf_popid=" + sPop + "&hapf_haplotype=" + sHaplotype;
			 xmlHttp.open("GET", sURL, true);
			 xmlHttp.send(null);
		}
		else
		{
			alert("Please enter a haplotype by adding alleles.");
			document.getElementById("hapd_allele").focus();		
			return false;
		}
	}
	else
	{
		alert("Please enter a valid frequency.");
		document.getElementById("hapf_freq").focus();
		return false;		
	}
}
function ajaxhla2002a_del(sHapf_popid, sHapf_line)
{
    var xmlHttp;
	var sURL="ajaxhla2002a_del.asp";
	var sResponse="";
	
	var bAgree=confirm("Do yo want to delete this haplotype?");
		
	if (bAgree)	
	{
	 try
     {  
         // Firefox, Opera 8.0+, Safari  
         xmlHttp=new XMLHttpRequest();  
     }
     catch (e)
     { 
         // Internet Explorer  
         try
         {    
               xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
         }
         catch (e)
         {    
               try
               {      
                     xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");     
               }
               catch (e)
               {      
                     //alert("Your browser does not support AJAX!");      
                     return false;      
               }    
         }  
     }
   
     xmlHttp.onreadystatechange=function()
     {
         if(xmlHttp.readyState==4)
         {
				   sResponse = xmlHttp.responseText;
				   if(sResponse != "OK")
				   {									   	
						return false;
				   }
				   else
				   {
					   window.location="hla2002a.asp?hapf_popid=" + sHapf_popid;
					   return true;
				   }
         }
     }
	 sURL = sURL + "?" + "hapf_popid=" + sHapf_popid + "&hapf_line=" + sHapf_line;
     xmlHttp.open("GET", sURL, true);
     xmlHttp.send(null);  
	}
	else
	{
			return false;
	}
}
